Skip to content

Add workflow engine with catalog system#2158

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-workflow-engine-catalog-system
Draft

Add workflow engine with catalog system#2158
Copilot wants to merge 4 commits intomainfrom
copilot/add-workflow-engine-catalog-system

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

Adds a workflow subsystem to Specify CLI for defining multi-step, resumable automation workflows in YAML. The engine dispatches commands to CLI-based integrations, evaluates control flow, and pauses at human review gates. Ships with a catalog system mirroring the existing extension/preset catalog pattern.

Workflow engine core (src/specify_cli/workflows/)

  • base.pyStepBase abstract class, StepContext, StepResult, status enums
  • __init__.pySTEP_REGISTRY with auto-discovery, mirrors INTEGRATION_REGISTRY
  • expressions.py — Sandboxed Jinja2-subset evaluator (variable interpolation, comparisons, boolean logic, filters like default, join, map, contains)
  • engine.pyWorkflowDefinition (YAML loader), validate_workflow(), WorkflowEngine (sequential executor with recursive nested step support), RunState (JSON state persistence for resume)
  • catalog.pyWorkflowCatalog (multi-catalog stack: env var → project → user → built-in), WorkflowRegistry (installed workflow tracking)

9 built-in step types (workflows/steps/)

command, shell, gate, if (then/else), switch, while, do-while, fan-out, fan-in — each a StepBase subclass in its own subpackage, same extensibility model as integrations.

CLI commands

specify workflow run|resume|status|list|add|remove|search|info plus specify workflow catalog list|add|remove.

Catalog files

workflows/catalog.json, workflows/catalog.community.json, and an example workflows/speckit/workflow.yml (full SDD cycle).

Example workflow definition

schema_version: "1.0"
workflow:
  id: "sdd-pipeline"
  name: "SDD Pipeline"
  version: "1.0.0"
  integration: claude

inputs:
  feature_name:
    type: string
    required: true

steps:
  - id: specify
    command: speckit.specify
    input:
      args: "{{ inputs.feature_name }}"

  - id: review-spec
    type: gate
    message: "Review the generated spec."
    options: [approve, reject]
    on_reject: abort

  - id: check-scope
    type: if
    condition: "{{ inputs.scope == 'full' }}"
    then:
      - id: full-plan
        command: speckit.plan
        integration: gemini
        model: gemini-2.5-pro
    else:
      - id: quick-plan
        command: speckit.plan

Tests

94 new tests covering step registry, expression engine, all step types, workflow validation, engine execution (including branching/gates/shell), state persistence, catalog resolution, and registry operations. Full suite passes (1334 total).

Copilot AI requested review from Copilot and removed request for Copilot April 10, 2026 16:30
Copilot AI linked an issue Apr 10, 2026 that may be closed by this pull request
…stem, and CLI commands

Agent-Logs-Url: https://github.com/github/spec-kit/sessions/72a7bb5d-071f-4d67-a507-7e1abae2384d

Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 10, 2026 16:44
definition = None
try:
definition = engine.load_workflow(workflow_id)
except FileNotFoundError:
Copilot AI requested review from Copilot and removed request for Copilot April 10, 2026 16:48
Copilot AI requested review from Copilot and removed request for Copilot April 10, 2026 16:51
Copilot AI changed the title [WIP] Add workflow engine with catalog system to Specify CLI Add workflow engine with catalog system Apr 10, 2026
Copilot AI requested a review from mnriem April 10, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow Engine with Catalog System

2 participants